﻿// --------------------------------------------------------------------------------------
// <copyright file="RouteCollectionExtensions.cs" company="NGroup">
// Copyright (c) NGroup. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------
// <history>
//     <change who="Bui Thanh Nam" date="2013.12.04">Create</change>
// </history>
// --------------------------------------------------------------------------------------

namespace NGroup.VTL.Core.Routing
{
    using System.Web.Routing;

    /// <summary>
    /// Class RouteCollectionExtensions.
    /// </summary>
    public static class RouteCollectionExtensions
    {
        /// <summary>
        /// Maps the hyphenated route.
        /// </summary>
        /// <param name="routes">The routes.</param>
        /// <param name="name">The name.</param>
        /// <param name="url">The URL.</param>
        /// <param name="defaults">The defaults.</param>
        /// <returns>Route.</returns>
        public static Route MapHyphenatedRoute(
                this RouteCollection routes,
                string name, string url,
                object defaults)
        {
            var route = new HyphenatedRoute(url, defaults);
            routes.Add(name, route);
            return route;
        }

        public static Route MapHyphenatedRoute(
                this RouteCollection routes,
                string name, string url,
                object defaults,
                object constraints)
        {
            var route = new HyphenatedRoute(url, defaults, constraints);
            routes.Add(name, route);
            return route;
        }
    }
}
